<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ProductAddSequence extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn('recommend_flag');
            $table->integer('sequence')->default(0)->comment('排序字段');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->tinyInteger('recommend_flag')->default(0)->comment('推荐标记, 0表示不推荐');
            $table->dropColumn('sequence');
        });
    }
}
